#include "light.h"
namespace tls{
  light::~light(){}

  //point light
  vec3 point_light::L(const isect& hit,vec3& wi)const{
    wi=pos - hit.p;
    real sqd=wi.sqlen();
    return intensity / sqd;
  }
  point_light::~point_light(){}

  void* create_point_light(std::FILE* file){
    vec3 p,i;
    fscanf(file,"%lf%lf%lf",&p.x,&p.y,&p.z);
    fscanf(file,"%lf%lf%lf",&i.x,&i.y,&i.z);
    return new point_light(p,i);
  }
}//namespace tls
